<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script src="./js/vue.js"></script>
    <div id='app'>
       <p>{{price}}</p>
       <p>比原价高了{{height}}钱</p>
       <button @click="change()">递加10</button>
    </div>
    
    <script>
        let app =new Vue({
             el:"#app",
             data:{
                price:100,
                height:0
             },
             methods:{
                change(){
                    this.price+=10;
                }
             },
             watch:{
                price(newValue,oldValue){
                    this.height=newValue-100
                },
       
             }
        })
    </script>
</body>
</html>